package com.xcity.pomelo.response;

import com.xcity.db.entity.Player;
import com.xcity.game.buildv2.BuildV2;
import com.xcity.game.item.ItemTemplate;
import com.xcity.pomelo.response.BuildV2Response.ExpBookTempInfo;
import com.xcity.pomelo.response.BuildV2Response.ExpExtendInfo;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class BuildPutExpBookResponse extends Response{
	public int buildId;
	//建筑加经验信息
//	public int takeExpElapseSecond;//距离上次领取多少秒 用于判断是否可领
//	public int lastPutExpBookSecond;//距离上次放经验书多少秒 用于判断技能书什么时候耗完 -1没放书
//	public int[] putEmployeeSeconds;//距离上次放员工多少秒 4个槽记4次 用于判断可领多少经验 -1没员工
	public ExpBookTempInfo expBookInfo;//经验书相关简化信息
	public ExpExtendInfo expExtendInfo;
	
	public BuildPutExpBookResponse(int serial, Player player, BuildV2 building){
		super(serial);
		this.buildId = building.getId();
//		//建筑员工加经验
//		this.takeExpElapseSecond = building.calcTakeExpElapseSecond();
//		this.lastPutExpBookSecond = building.calcLastPutExpBookSecond();
//		for(int i = 0; i < BuildV2.MAX_SLOT; i++){
//			//四个员工 每个已经放了多少秒
//			this.putEmployeeSeconds[i] = building.employeePutSecondBySlotIndex(i);
//		}
		ItemTemplate itemTemplate = building.tryGetExpBookTemplate();
		if(itemTemplate != null){
			this.expBookInfo = new ExpBookTempInfo(itemTemplate);
		}
		this.expExtendInfo = new ExpExtendInfo(building);
	}
}
